<?php
#Script that tracks the  actual charts position and save it in 'charts'

include 'myspacerawler.php';


$crawler = new MySpaceCrawler('output_neu1.txt','myspacedec18','localhost','root','root');
//$crawler->actualDate = '2010-01-03 19:58:41';

$crawler->print_out("\nChart update into charts: ") ;
$charts = $crawler->getArtistsFromUnsignedCharts(1,200);
$crawler->print_out("\nDone") ;
mysql_query("CREATE TABLE IF NOT EXISTS `charts` (`date` DATE, `pos` SMALLINT UNSIGNED, `artist` INT UNSIGNED, PRIMARY KEY(`date`,`pos`), INDEX(`date`)) TYPE = MyISAM ;");
echo mysql_error();
foreach($charts as $friendID){
	$crawler->writeUnsignedArtistsCharts($friendID,++$pos);
}

?>